<?php 
	//Directory config
	define('DIR', '/CSSE3004/website'); //The folder where the index.php is. Improves flexibility
	
	//Database config
	define('DATABASE_URI', 'localhost'); 		//URI for the database
	define('DATABASE_USER', 'root'); 			//Username for the database
	define('DATABASE_PASS', 'root');			//Password for the database
	define('DATABASE_NAME', 'dangertracker');	//Name of the database
	
	//Tables config
	define('USER_TABLE', 'user'); 								//Table for the user
	define('SESSION_TABLE', 'session');							//Table for the session
	define('DOCTOR_TABLE', 'doctor'); 							//Table for the doctor
	define('PATIENT_TABLE', 'patient'); 						//Table for the patient
	define('DATALOG_TABLE', 'datalog'); 						//Table for the data log
	define('DATALOG_TYPE_TABLE', 'datalog_type'); 				//Table for the data log type
	define('HOSPITAL_TABLE', 'hospital'); 						//Table for the hospital
	define('DOCTOR_HOSPITAL_TABLE', 'doctor_hospital'); 		//Table for the doctor hospital
	define('DOCTOR_PATIENT_TABLE', 'doctor_patient'); 			//Table for the doctor patient
	define('NOTIFICATION_TABLE', 'notification'); 				//Table for the notification
	define('NOTIFICATION_TYPE_TABLE', 'notification_type'); 	//Table for the notification type
	define('SYMPTOM_TABLE', 'symptom'); 						//Table for the symptom
	define('USER_ANDROID_TABLE', 'user_android'); 				//Table for the user android 
	define('FOOD_TABLE', 'food'); 								//Table for the food
	define('USER_EMAIL_TABLE', 'user_email'); 					//Table for user emails
	
	define('SALT_LENGTH', 16); //SALT LENGTH can be changed for higher security
	
	define('TIMEZONE', 'Australia/Brisbane');	//Timezone
	date_default_timezone_set(TIMEZONE);		//Set timezone	
	
	define('DATE_FORMAT', 'Y-m-d H:i:s');		//Date format used

	//Graph settings
	define('GRAPH_WIDTH', 800);
	define('GRAPH_HEIGHT', 500);	
	define('GRAPH_WIDTH_LARGE', 1000);
	define('GRAPH_HEIGHT_LARGE', 750);
	define('GRAPH_DIR', "temp/");
	define('GRAPH_FILEFORMAT', "png");
	define('GRAPH_DATATYPE', "text-data");
	define('GRAPH_PLOTTYPE', "linepoints");
	define('GRAPH_YTICK_INCREMENT', 10);
	define('GRAPH_XTICK_INCREMENT', 1);
	define('GRAPH_TTFPATH', "graph/");
	define('GRAPH_TTFFONT', "Arial.ttf");
	
	define('GRAPH_TTFFONT_GENERIC', 14);
	define('GRAPH_TTFFONT_LEGEND', 14);
	define('GRAPH_TTFFONT_TITLE', 22);
	define('GRAPH_TTFFONT_XLABEL', 10);
	define('GRAPH_TTFFONT_YLABEL', 10);
	define('GRAPH_TTFFONT_XTITLE', 14);
	define('GRAPH_TTFFONT_YTITLE', 14);
	
	define('GRAPH_PLOT_BGCOLOR', "white");
	define('GRAPH_BGCOLOR', "white");
	define('GRAPH_PLOT_BORDERTYPE', "left");
	
	define('GRAPH_DATA_COLORS', serialize(array( "red", "blue")));
	
	//E-mail setting
	define('EMAIL_FROM', 'root@localhost');
	define('EMAIL_FROMNAME', 'Dangertracker Admin');
	define('EMAIL_SENDMAIL_PATH', '/usr/sbin/sendmail');
	define('EMAIL_HOST', 'smtp.gmail.com');
	define('EMAIL_PORT', 465); 
	define('EMAIL_SMTP_SECURE', 'ssl');  //Options are "", "ssl" or "tls"
	define('EMAIL_SMTP_AUTH', true);
	define('EMAIL_USERNAME', 'dangertracker3005@gmail.com');
	define('EMAIL_PASSWORD', 'dangertrack');
	define('EMAIL_SMTP_TIMEOUT', 10);
	
	//Notifications template
	//TYPE_PERSON_MSG is the variable format. TYPE is the type of message and PERSON is the person who will be receiving it.
	define('REQUEST_DOCTOR_MSG', 'You have received a request from patient PERSON.');	//Notification for request on the doctor side
	define('REQUEST_PATIENT_MSG', 'Your request to doctor PERSON has been accepted.'); 	//Notification for request on the patient side
	define('LOG_DOCTOR_MSG', 'PERSON has entered a new TYPE of VALUE.'); 				//Notification for log on the doctor side
	
	//Notification for symptom on the doctor side
	define('SYMPTOM_DOCTOR_MSG', 'PERSON has entered a new symptom of SYMPTOM level LEVEL.'); 
	//Notification for food diary on the doctor side
	define('FOOD_DOCTOR_MSG', 'PERSON has entered a new food diary entry of FOOD containing CALORIES calories.'); 

	define('REMINDER_USER_MSG', 'You have a reminder at TIME. It says: MESSAGE.'); 		//Notification for request on the doctor side
	
	//Default messages
		//Username errors
	define('ERROR_USERNAME_TAKEN', 'Username has already been taken.');
	define('ERROR_USERNAME_SHORT', 'Username must be more than 4 characters.');
	define('ERROR_USERNAME_INVALID', 'Username is invalid. Username can only be letters or underscore. (A-z, 0-9, _)');	
		
		//Password errors
	define('ERROR_PASSWORD_SHORT', 'Password must be more than 8 characters.');
	define('ERROR_PASSWORD_DIFFERENT', 'Passwords do not match.');
	
		//E-mail errors
	define('ERROR_EMAIL_REQUIRED', 'E-mail is required.');
	define('ERROR_EMAIL_TAKEN', 'E-mail has already been used.');

		//Change e-mail messages
	define('MSG_EMAIL_CHANGE_REQUESTED', 'You have requested an e-mail change.');
	define('MSG_EMAIL_CHANGE_REMOVED', 'You have removed the request to change your e-mail.');
	define('MSG_EMAIL_CHANGE_CONFIRMED', 'You have confirmed that you are changing your e-mail.');
	define('MSG_EMAIL_CHANGE_UNCONFIRMED', 'You have not confirmed that you are changing your e-mail. Wrong token.');
	
		//Sign up errors
	define('ERROR_FIRSTNAME_REQUIRED', 'First name is required.');
	define('ERROR_LASTNAME_REQUIRED', 'Last name is required.');
	define('ERROR_REGNO_REQUIRED', 'Doctor Registration No. is required.');
	
		//Login errors
	define('ERROR_LOGIN_INVALID', 'Invalid username or password.');
	define('ERROR_ACCESS_INVALID', 'You need to login to access that part of the site.');
	
		//Valid messages
	define('ERROR_ACCOUNT_INVALID', 'Your account is not valid, please validate your account with the token in your e-mail.');
	define('ERROR_TOKEN_INVALID', 'Your account has not been validate. Wrong token.');
	define('MSG_ACCOUNT_VALIDATED', 'Your account has been validated.');
	
		//Profile messages
	define('ERROR_DOCTOR_UNVERIFIED', 'Your doctor account needs to be verified before it is publically displayed. 
									   Please wait until it is verified. Contact the admin for more details.');

	define('MSG_ACCOUNT_VALID', 'You have successfully validated your account.');
	define('MSG_TOKEN_SENT', 'Token has been sent to your e-mail. Please check your Junk Mail in case.');
	define('MSG_ADDRESS_NONE', 'No address stated.');
	define('MSG_CONTACT_NONE', 'No contact stated.');
	
		//Request messages
	define('MSG_REQUEST_REMOVED', 'You have successfully removed a request.');
	define('MSG_REQUEST_PENDING', 'You have already sent a request. Waiting for doctor to accept.');
	define('MSG_DOCTOR_ATTACHED', 'You are already under this doctor.');
	define('MSG_REQUEST_NONE', 'You have sent no requests at this moment.');
	
		//Patients Request messages
	define('MSG_REQUEST_ACCEPTED', 'You have successfully accepted a request.');
	define('MSG_PATIENT_NONE', 'You have no patients or requests at this moment.');
	
		//Log messages
	define('MSG_LOG_CREATED', 'You have successfully created a log.');
	define('ERROR_LOG_EMPTY', 'No values input. Failed to create a log.');
	define('ERROR_LOG_INVALID', 'Values input are not a number. Failed to create a log.');
	define('MSG_LOG_REMOVED', 'You have successfully removed a log.');
	define('MSG_BENCHMARK_PARTICIPATE', 'You are now participating in benchmarking.');
	define('MSG_BENCHMARK_UNPARTICIPATE', 'You are no longer participating in benchmarking.');	
	define('MSG_BENCHMARK_DATA', 'No benchmarking data available.');
	define('MSG_LOG_NONE', 'No log entry.');	
	
		//Symptom messages
	define('MSG_SYMPTOM_CREATED', 'You have successfully created a symptom log.');
	define('ERROR_SYMPTOM_EMPTY', 'No values input. Failed to create a symptom log.');
	define('MSG_SYMPTOM_REMOVED', 'You have successfully removed a symptom log.');
	define('MSG_SYMPTOM_NONE', 'No symptom entry.');	

		//Food messages
	define('MSG_FOOD_CREATED', 'You have successfully created a food diary entry.');
	define('ERROR_FOOD_EMPTY', 'No calories input. Failed to create a food diary entry.');
	define('ERROR_FOOD_INVALID', 'Calories input is not a number. Failed to create a food diary entry.');
	define('MSG_FOOD_REMOVED', 'You have successfully removed a food diary entry.');
	define('MSG_FOOD_NONE', 'No food entry.');	

		//Update messages
	define('MSG_PROFILE_UPDATED', 'You have successfully updated your profile.');
	define('MSG_PASSWORD_CHANGED', 'You have successfully changed your password.');
	define('ERROR_PASSWORD_INCORRECT', 'Incorrect password.');
	
		//Reset Password messages
	define('MSG_PASSWORD_RESET', 'Your password has been reset and sent to your e-mail.');
	define('ERROR_EMAIL_WRONG', 'Your username does not match the e-mail.');
	
		//Android message
	define('MSG_ANDROID', 'You are using an Android. We have an Android application for you! 
							Please download it from this <a href="downloads/HealthTracker.apk">link</a>');
	
		//Index message
	define('ABOUT_HEALTH_TRACKER', 'Health tracker was designed to enable users to track their fitness and personal goals, 
									with oversight provided by doctors.<br /><br /> 
									Designed with simplicity in mind this project aims to give maximum benefit to the end user 
									with little input or effort required, so log in or sign up today!');
		//Index message
	define('MSG_SIGNUP_COMPLETED', 'Thank you for signing up. 
									Please validate your account through your e-mail or log in to validate using the token.');
		//Unauthorized message
	define('MSG_UNAUTHORIZED', 'You are not allowed to be here.');
	
		//Graphing message
	define('MSG_GRAPH_UNAVAILABLE', 'No data available for graphing.');
	
		//Notification message
	define('MSG_NOTIFICATION_NONE', 'You have no notifications at this moment.');
	
		//Patient message
	define('MSG_PATIENT_NONEXISTENT', 'No such patient.');
		
		//Calendar Function
	define('SHOW_DATE_SELECTION', true);
	define('SHOW_COLOR_SELECTION', true);

	//Required
		//Require classes
	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/class/database.php'); 		//Database is required first
	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/class/session.php');		//Session is required after database
	
	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/class/user.php');			//User is required first before Patient and Doctor
	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/class/patient.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/class/doctor.php');
	
	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/class/hospital.php');
	
	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/class/symptom.php');	
	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/class/datalog.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/class/food.php');

	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/class/notification.php');
	
		//Require other libraries
	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/mail/class.phpmailer.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/graph/phplot.php');
	
		//Require Google API
	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/google-api/src/apiClient.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . DIR . '/google-api/src/contrib/apiCalendarService.php');
	
	
?>